﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace wpf.Triage.Convert
{
    public class NotNullValVisiblityConvert : IValueConverter
    {
        /// <summary>
        /// 字符串转显隐  2022-03-28
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (string.IsNullOrEmpty(System.Convert.ToString(value)))
            {
                return Visibility.Collapsed;
            }
            else
            {
                return Visibility.Visible;
            }
        }
        /// <summary>
        /// 接口实现  2022-03-28
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return string.Empty;
        }

    }
}
